﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InstallManager.Msi
{
    public enum MsiError : uint
    {
        AccessDenied = 5
        ,
        AppHelpBlock = 1259
        ,
        BadConfiguration = 1610
        ,
        BadPathName = 161
        ,
        BadQuerySyntax = 1615
        ,
        BadUserName = 2202
        ,
        CallNotImplemented = 120
        ,
        CreateFailed = 1631
        ,
        DatatypeMismatch = 1629
        ,
        Directory = 267
        ,
        DiskFull = 112
        ,
        E_Fail = 2147500037
        ,
        FileInvalid = 1006
        ,
        FileNotFound = 2
        ,
        FunctionFailed = 1627
        ,
        FunctionNotCalled = 1626
        ,
        IndexAbsent = 1611
        ,
        InstallAlreadyRunning = 1618
        ,
        InstallFailure = 1603
        ,
        InstallLanguageUnsupported = 1623
        ,
        InstallLogFailure = 1622
        ,
        InstallNotUsed = 1634
        ,
        InstallPackageInvalid = 1620
        ,
        InstallPackageOpenFailed = 1619
        ,
        InstallPackageRejected = 1625
        ,
        InstallPackageVersion = 1613
        ,
        InstallPlatformUnsupported = 1633
        ,
        InstallRemoteDisallowed = 1640
        ,
        InstallRemoteProhibited = 1644
        ,
        InstallServiceFailure = 1601
        ,
        InstallSourceAbsent = 1612
        ,
        InstallSuspend = 1604
        ,
        InstallTempUnwritable = 1632
        ,
        InstallTransformFailure = 1624
        ,
        InstallTransformRejected = 1643
        ,
        InstallUIFailure = 1621
        ,
        InstallUserExit = 1602
        ,
        InvalidCommandLine = 1639
        ,
        InvalidData = 13
        ,
        InvalidDataType = 1804
        ,
        InvalidField = 1616
        ,
        InvalidHandle = 6
        ,
        InvalidHandleState = 1609
        ,
        InvalidParameter = 87
        ,
        InvalidTable = 1628
        ,
        MoreData = 234
        ,
        NoData = 232
        ,
        NoError = 0
        ,
        NoMoreItems = 259
        ,
        NotEnoughMemory = 8
        ,
        OpenFailed = 110
        ,
        OutOfMemory = 14
        ,
        PatchPackageInvalid = 1636
        ,
        PatchPackageOpenFailed = 1635
        ,
        PatchPackageUnsupported = 1637
        ,
        PatchTargetNotFound = 1642
        ,
        ProductUninstalled = 1614
        ,
        ProductVersion = 1638
        ,
        Success = 0
        ,
        SuccessRebootInitiated = 1641
        ,
        SucessRebootRequired = 3010
        ,
        UnknownComponent = 1607
        ,
        UnknownFeature = 1606
        ,
        UnknownProduct = 1605
        ,
        UnknownProperty = 1608
        ,
        UnsupportedType = 1630

    }
    [Flags]
    internal enum PlatformArchitecture : uint
    {
        Current
        ,
        IA64
        ,
        X86

    }
    internal enum MsiInstallType
    {
        Default
        ,
        NetworkImage
        ,
        SingleInstance

    }
    internal enum MsiInstallState
    {
        Absent = 2
        ,
        Advertised = 1
        ,
        BadConfig = -6
        ,
        Broken = 0
        ,
        Default = 5
        ,
        Incomplete = -5
        ,
        InvalidArg = -2
        ,
        Local = 3
        ,
        MoreData = -3
        ,
        NotUsed = -7
        ,
        Removed = 1
        ,
        Source = 4
        ,
        SourceAbsent = -4
        ,
        Unknown = -1

    }
    internal enum MsiInstallMode
    {
        Default = 0
        ,
        Existing = -1
        ,
        NoDetection = -2
        ,
        NoSourceResolution = -3

    }
    public enum MsiInstallMessage : long
    {
        ActionData = 150994944
        ,
        ActionStart = 134217728
        ,
        CommonData = 184549376
        ,
        Error = 16777216
        ,
        FatalExit = 0
        ,
        FilesInUse = 83886080
        ,
        Info = 67108864
        ,
        Initialize = 201326592
        ,
        OutOfDiskSpace = 117440512
        ,
        Progress = 167772160
        ,
        ResolveSource = 100663296
        ,
        ShowDialog = 234881024
        ,
        Terminate = 218103808
        ,
        User = 50331648
        ,
        Warning = 33554432

    }
    internal enum MsiInstallLevel
    {
        Default = 0
        ,
        Maximum = 65535
        ,
        Minimum = 1
    }

    internal enum MsiAdvertismentOptions : uint
    {
        Instance
        ,
        None

    }
    [Flags]
    internal enum MsiTransformError
    {
        AddExistingRow = 1
        ,
        AddExistingTable = 4
        ,
        ChangeCodePage = 32
        ,
        DelMissingRow = 2
        ,
        DelMissingTable = 8
        ,
        None = 0
        ,
        UpdateMissingRow = 16
        ,
        ViewTransform = 256

    }
    [Flags]
    internal enum MsiValidationFlag
    {
        Language = 1
        ,
        MajorVersion = 8
        ,
        MinorVersion = 16
        ,
        NewEqualBaseVersion = 256
        ,
        NewGreaterBaseVersion = 1024
        ,
        NewGreaterEqualBaseVersion = 512
        ,
        NewLessBaseVersion = 64
        ,
        NewLessEqualBaseVersion = 128
        ,
        None = 0
        ,
        Product = 2
        ,
        UpdateVersion = 32
        ,
        UpgradeCode = 2048

    }
    internal enum MsiCondition
    {
        Error
        ,
        False
        ,
        None
        ,
        True

    }
    [Flags]
    public enum MsiInstallLogMode : uint
    {
        ActionData = 512
        ,
        ActionStart = 256
        ,
        CommonData = 2048
        ,
        Error = 2
        ,
        ExternalUI = 20239
        ,
        ExtraDebug = 8192
        ,
        FatalExit = 1
        ,
        Info = 16
        ,
        Initialize = 4096
        ,
        None = 0
        ,
        OutOfDiskSpace = 128
        ,
        Progress = 1024
        ,
        PropertyDump = 1024
        ,
        ResolveSource = 64
        ,
        ShowDialog = 16384
        ,
        Terminate = 8192
        ,
        User = 8
        ,
        Verbose = 4096
        ,
        Warning = 4

    }
    internal enum MsiLogAttribute
    {
        Append = 1
        ,
        FlushEachLine = 2

    }
    internal enum MsiDbState
    {
        Error = -1
        ,
        Read = 0
        ,
        Write = 1

    }
    internal enum MsiDbPersistMode
    {
        Create = 3
        ,
        CreateDirect = 4
        ,
        Direct = 2
        ,
        PatchFile = 8
        ,
        ReadOnly = 0
        ,
        Transact = 1

    }
    internal enum MsiCostTree
    {
        Children
        ,
        Parents
        ,
        Reserved
        ,
        SelfOnly

    }
    [Flags]
    internal enum MsiInstallFeatureAttribute
    {
        All = 31
        ,
        DisallowAdvertise = 16
        ,
        FavorAdvertise = 8
        ,
        FavorLocal = 1
        ,
        FavorSource = 2
        ,
        FollowParent = 4
        ,
        NounSupportedAdvertise = 32

    }
    [Flags]
    internal enum MsiFeatureInstallState
    {
        Absent = 4
        ,
        Advertised = 2
        ,
        Default = 32
        ,
        Local = 8
        ,
        Source = 16

    }
    internal enum MsiRunMode
    {
        Admin
        ,
        Advertise
        ,
        Cabinet
        ,
        Commit
        ,
        LogEnabled
        ,
        Maintenance
        ,
        Operations
        ,
        RebootAtEnd
        ,
        RebootNow
        ,
        Reserved11
        ,
        Reserved14
        ,
        Reserved15
        ,
        Rollback
        ,
        RollbackEnabled
        ,
        Scheduled
        ,
        SourceShortNames
        ,
        TargetShortNames
        ,
        Windows9x
        ,
        ZawEnabled

    }

    internal enum MsiUserInfoState
    {
        Absent = 0
        ,
        InvalidArg = -2
        ,
        MoreData = -3
        ,
        Present = 1
        ,
        Unknown = -1

    }

    internal enum MsiOpenPackageFlags : uint
    {
        IgnoreMachineState
        ,
        None

    }
    internal enum MsiAssemblyInfo : uint
    {
        NetAssembly
        ,
        Win32Assembly

    }

    [Flags]
    internal enum MsiReinstallMode : uint
    {
        FileEqualVersion = 8
        ,
        FileExact = 16
        ,
        FileMissing = 2
        ,
        FileOlderVersion = 4
        ,
        FileReplace = 64
        ,
        FileVerify = 32
        ,
        MachineData = 128
        ,
        Package = 1024
        ,
        Repair = 1
        ,
        Shortcut = 512
        ,
        UserData = 256

    }
    internal enum MsiInstallUILevel : uint
    {
        Basic = 3
        ,
        Default = 1
        ,
        EndDialog = 128
        ,
        Full = 5
        ,
        HideCancel = 32
        ,
        NoChange = 0
        ,
        None = 2
        ,
        ProgressOnly = 64
        ,
        Reduced = 4
        ,
        SourceResOnly = 256

    }
    internal enum VariantType : uint
    {
        Array = 8192
        ,
        Blob = 65
        ,
        BlobObject = 70
        ,
        Bool = 11
        ,
        BStr = 8
        ,
        ByRef = 16384
        ,
        ClipFormat = 71
        ,
        CLSID = 72
        ,
        Currency = 6
        ,
        Date = 7
        ,
        Decimal = 14
        ,
        Empty = 0
        ,
        Error = 10
        ,
        Filetime = 64
        ,
        I1 = 16
        ,
        I2 = 2
        ,
        I4 = 3
        ,
        I8 = 20
        ,
        Int = 22
        ,
        LPStr = 30
        ,
        LPWStr = 31
        ,
        Null = 1
        ,
        R4 = 4
        ,
        R8 = 5
        ,
        Storage = 67
        ,
        StoredObject = 69
        ,
        Stream = 66
        ,
        StreamObject = 68
        ,
        TypeMask = 4095
        ,
        UI1 = 17
        ,
        UI2 = 18
        ,
        UI4 = 19
        ,
        UI8 = 21
        ,
        UInt = 23
        ,
        Variant = 12
        ,
        Vector = 4096

    }
    internal enum MsiColInfoType
    {
        Names
        ,
        Types

    }
    internal enum MsiDbError
    {
        BadCabinet = 26
        ,
        BadCase = 8
        ,
        BadCategory = 23
        ,
        BadCondition = 15
        ,
        BadCustomSource = 20
        ,
        BadDefaultDir = 18
        ,
        BadFilename = 13
        ,
        BadFormatted = 16
        ,
        BadGUID = 9
        ,
        BadIdentifier = 11
        ,
        BadKeyTable = 24
        ,
        BadLanguage = 12
        ,
        BadLink = 3
        ,
        BadLocalizedAttrib = 29
        ,
        BadMaxMinValues = 25
        ,
        BadPath = 14
        ,
        BadProperty = 21
        ,
        BadRegPath = 19
        ,
        BadShortcut = 27
        ,
        BadTemplate = 17
        ,
        BadVersion = 7
        ,
        BadWildcard = 10
        ,
        DuplicateKey = 1
        ,
        FunctionError = -1
        ,
        InvalidArg = -3
        ,
        MissingData = 22
        ,
        MoreData = -2
        ,
        NoError = 0
        ,
        NotInSet = 6
        ,
        Overflow = 4
        ,
        Required = 2
        ,
        StringOverflow = 28
        ,
        Underflow = 5

    }
    internal enum MsiModify
    {
        Assign = 3
        ,
        Delete = 6
        ,
        Insert = 1
        ,
        InsertTemporary = 7
        ,
        Merge = 5
        ,
        Refresh = 0
        ,
        Replace = 4
        ,
        Seek = -1
        ,
        Update = 2
        ,
        Validate = 8
        ,
        ValidateDelete = 11
        ,
        ValidateField = 10
        ,
        ValidateNew = 9

    }
}
